package businesslogic.strategybl;

import po.StrategyPO;
import dataservice.coursedataservice.CourseDataService;
import dataservice.coursedataservice.LessonDataService;
import dataservice.datafactoryservice.DataFactory;
import dataservice.datafactoryservice.DataFactoryService;
import dataservice.strategydataservice.StrategyDataService;
import vo.Message;
import vo.StrategyVO;

public class Strategy {
	StrategyDataService strategyData;

	public Strategy() {
		DataFactoryService dataFactory = new DataFactory();
		strategyData = dataFactory.getStrategyData();
	}

	public Message updateStrategy(StrategyVO vo) {
		StrategyPO po=new StrategyPO(vo.getTotalCredit());
		boolean result=strategyData.update(po);
		if(result){
			return Message.SUCCESS;
		}else{
			return Message.NOT_SUCCESS;
		}
	}

	public StrategyVO getStrategy() {
		StrategyPO po=strategyData.find();
		StrategyVO vo=new StrategyVO(po);
		return vo;
	}

}
